<?php require_once('../../core/import.php');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
 	<script type="text/javascript" src="../../scripts/import.js"></script>
    <script type="text/javascript">
        //该脚本仅用于演示，具体使用时归入.js文件中。
        window.addEvent('load',function()
        {
            //菜单事件
			$('Count').addEvent('change',function(e)
			{
				var template='<input type="File" id="File$" name="File$" class="Textbox" />';
				var content='';
                if(isNaN(this.value))
                {
                    alert('请选择文件数量');
                }
                else
                {
                    for(i=0;i<this.value;i++)
                    {
                        content+=template.replace(/\$/g,i+1);
                    }
                    $('FilePanel').innerHTML=content;
                }				
			});

            //按钮事件
            $('Submit').addEvent('click', function(e)
            {
                var count=$('Count');
                if(count.value=='none')
                {
                    malert('请选择上传文件的数量');
                    count.focus();
                    return false;
                }
            });
        });
    </script>
</head>

<body>
    <form id="Form1" name="Form1" method="post" action="9.upload.batch.action.php" enctype="multipart/form-data">
        <select id="Count" name="Count">
        	<option value="none">-- 请选择上传文件数量 --</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
        </select>
        <div id="FilePanel"></div>
        <input type="submit" id="Submit" name="Submit" value="提交" class="button" />
    </form>
</body>
</html>